Skip to content

Inbox: 👍 Looks good is sent through to the agent - #1980

Merged
backnotprop merged 3 commits into
mainfrom
inbox-ack-sends
Oct 17, 2026
Merged

backnotprop merged 3 commits into
mainfrom
inbox-ack-sends

Conversation

@backnotprop

@backnotprop backnotprop commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

The owner, on the Inbox's 👍 Looks good: "I replied with looks good, but I realized that doesn't send through. I think we just need to send looks good through, honestly."

Until now 👍 was silent: it stored an ack on the agent's message and marked the thread read. An agent saw it only when it next called read_thread or wait_for_reply. With this change, the 👍 reaches the agent that wrote the message once the same 10 s Undo window has passed. The toast's Undo (or Z) still takes it back before anything is sent.

Design: a note, delivered like a reply

When the window passes, settleAcks writes two lines:

  1. The ack line, with settled_seq / settled_at and the new note_id.
  2. The note that note_id names: a person's message with ack_of: <message id>, reply_to set to that message, and body inboxAckLine(<message id>).

The note goes through the existing reply machinery, so exactly-once delivery comes from the claim, lease and delivered event we already have. Nothing new on the connection side:

  • The bridge command stays a reply and adds ack_of. With ack_of, inboxWakeText produces:
    Plannotator Inbox: <subject> (<note id>)
    The person marked your message 👍 Looks good (<message id>). No reply needed unless you have a question.
    
    The line is inboxAckLine in the connection contract, and the mod has a byte-for-byte copy. An older connection words the command as a plain reply, with that same line as the person's words.
  • MCP-only agents: wait_for_reply keeps its acknowledged result. That result now records the note's delivery, so a connection never hands the agent the same 👍 again. A delivery through the wake also marks the ack seen, so a later wait across all threads is not answered by it either.
  • The note is one of the Inbox's own notes. isInboxNote now matches ack_of. The list's sent and unseen, the look, "came back" and readAt all read past it, so the thread stays read. thread() leaves it out, which keeps it out of the window, read_thread and the row's count and last_at.
  • Taken back after the window but before delivery (the pressed button, or Move back): the note stays in the log but is never handed out (ackNoteLive). A new 👍 later writes a new note.
  • The thread moved on inside the window: at settle time the Inbox re-checks ackMessage's conditions. If the person sent a real reply after the message, or the agent wrote again, the ack settles with not_sent: "replied" | "wrote_again". No note is written and no agent ever sees it (read_thread, wait_for_reply, the wake). The line under the message says "👍 Looks good · not sent: you replied" or "… not sent: wrote again".
  • Replay: old stores replay identically. An ack settled before this change has no note_id, was never sent, and is not sent now.

Downgrade

An older Inbox (before this PR) opening a store that holds notes reads a note as an ordinary person reply:

  • The thread shows it as "You: The person marked your message 👍 Looks good (…)".
  • Until an agent reads the thread, the row sits in Sent.
  • An undelivered note, or one whose 👍 was taken back, is handed to the agent as a reply.

Acks settled with not_sent write no note, so they behave as an older silent ack. The phone contract (adr/implementation/inbox-mobile.md, 7.56) now says a phone never displays a message with ack_of. The relay and the event stream send every line, so a phone that builds threads from lines must drop it.

The window

The line under the message (AckPill / ackPillLine) now moves through these states:

  1. "👍 Looks good · You, · goes to in a few seconds"
  2. Either "Queued for ; it gets this as its next turn." (the message came through a waking connection) or "Saved for . It sees it when it next reads this thread."
  3. "👍 Looks good · Delivered to , ", from the window thread's additive ack.delivered_at.

The wording follows the reply delivery line in #1968, but this PR does not depend on #1968. The toast now reads "Moves to Quiet · goes to unless you undo". Mark read, the row's "👍 Looks good", the layout and every refusal are unchanged. No new keyboard shortcuts.

Docs

  • AGENTS.md "👍 Looks good" and its route row.
  • plannotator inbox --help ("Where replies go").
  • read_thread's description, plus the regenerated inbox-default-tools.ts.
  • The marketing reference page.
  • The approval record has an "Amended 2026-10-16" note (outside the repo).

Tests

  • packages/shared/inbox/store-ack-delivery.test.ts (new; it also covers a reply and a newer agent message inside the window, both settled as not sent):
    • the two lines are written in order, and the note is handed to its session once
    • taking the 👍 back after it settled stops delivery, and so does Move back
    • replay from disk keeps the same state
    • a store written before this change sends nothing
  • packages/server/inbox-ack.test.ts:
    • the bridge command and the exact wake text
    • a held poll wakes on settle
    • an Undo inside the window sends nothing
    • acknowledged counts as the delivery
    • a restart hands nothing out again
    • Pi and OpenCode InboxWake with stand-in targets: one turn, then acknowledged
    • a reply inside the window: the agent gets the reply only, and the line says not sent
    • a newer agent question inside the window: no 👍 is sent, and wait_for_reply keeps waiting
  • apps/hook/hooks/mod/inbox.test.ts 12: the mod against a real Inbox. One turn arrives after the window with the exact text, and the window shows Delivered.
  • DOM, packages/inbox/ack.test.tsx: every line state, both not-sent lines included, and settled → saved → delivered over a real Inbox. The DOM server takes INBOX_DOM_SET_ASIDE_MS and a deliver stdin command.
  • e2e, tests/e2e/inbox-ack.spec.ts on the compiled binary:
    • pending, then Delivered through wait_for_reply
    • for a waking connection: Queued, then one bridge command naming the message, then Delivered
    • the phone layout

Local results:

  • bun run typecheck: clean.
  • bun test packages/server packages/shared packages/core tests apps/hook/hooks/mod: 4374 pass, 0 fail.
  • Inbox DOM tests: 600 pass, 0 fail.
  • inbox-ack.spec.ts: 6/6 pass.

After the Undo window the Inbox writes a note (a person's message with
ack_of) that the existing reply delivery hands to the session that wrote
the message, exactly once: a waking connection gets one short turn
naming the message, an MCP-only agent gets wait_for_reply's acknowledged.
The note is never listed in the thread; the line under the message says
pending, queued or saved, then Delivered to <agent>.
At settle, re-check ackMessage's conditions: a person reply or a newer
agent message after the acknowledged message settles the ack as
not_sent (replied / wrote_again) with no note, and no agent sees it.
The line says why. The mobile contract says a phone never displays a
message with ack_of. markAcksSeen's JSDoc back in place.
…ot sent

Server tests for the stored and live wait paths, after a reply and after
the agent wrote again inside the Undo window.
@backnotprop
backnotprop merged commit 43c248d into main Oct 17, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant